<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8"/>
    <title>提取行间事件</title>
 <script>
    window.onload = function(){       // window.onload:页面加载完成时发生
   	    var oBtn = document.getElementById('btn1');
        oBtn.onclick = function(){   //匿名函数
    	alert('abc');
        }  
    }
      
</script>
</head>
<body>
    <input id="btn1" type="button" value="按钮"/>
   
</body>
</html>


















































